package com.pan.creational.abstractfactory.factory;

import com.pan.creational.abstractfactory.utils.AbstractFactoryUtils;

public class CreateFactory {
    public static AbstractFactory create(String factoryType) throws Exception {
        String factoryName = AbstractFactoryUtils.INSTANCE.getClassname(factoryType);
        Object factory = Class.forName(factoryName).getConstructor().newInstance();
        return (AbstractFactory) factory;
    }
}
